package com.windliven.spoc.modules.salary.salarymanagement.utils;

import com.windliven.spoc.modules.salary.salarymanagement.pojo.enums.ResultEnum;
import com.windliven.spoc.modules.salary.salarymanagement.pojo.vo.ResultVo;

/**
 * @author fly
 * @version V1.0
 * @date 2018/11/14
 */
public class ResultUtil {

    public static ResultVo success(Object object) {
        return new ResultVo(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMsg(), object);
    }

    public static ResultVo success() {
        return success(null);
    }

    public static ResultVo error() {
        return error(ResultEnum.DEFAULT_ERROR);
    }

    public static ResultVo error(ResultEnum resultEnum) {
        return new ResultVo(resultEnum.getCode(), resultEnum.getMsg(), null);
    }


}